home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10184 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: athos.cc.bellcore.com!news
  2. From: "Sandeep V. Tamhankar" <stamhank@notes.cc.bellcore.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: CONVERTING INTEGER TO ASCII??????
  5. Date: 15 Mar 1996 16:24:57 GMT
  6. Organization: Bell Communications Research
  7. Message-ID: <4ic5kp$d0g@athos.cc.bellcore.com>
  8. References: <4i17r9$2kn@maltese.eag.unisysgsg.com> <4i1cvg$1cg@solutions.solon.com>
  9. NNTP-Posting-Host: nv-stamhankar.cc.bellcore.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.2 (Windows; U; 16bit)
  14.  
  15. Mr. Seebach, I think you've been reading this group for too long and have 
  16. become bitter about "beginners'" questions.  Granted that converting an 
  17. integer to ASCII is really easy, but people who've just started 
  18. programming in C need time to get used to the language and its immense 
  19. functionality.  I didn't learn about sprintf for a very long time after I 
  20. began programming in C.  Anyway, I'm going off the point.
  21.  
  22. Another way to convert integer to ASCII is to add char '0' to your 
  23. integer.  Like so:
  24.  
  25.              int asc;
  26.              asc= known_int + '0';
  27.  
  28. This way, you don't have to load any function and there is no overhead.
  29.  
  30. -----------------
  31. Sandeep V. Tamhankar
  32. Analysis Technician
  33. Signaling Capabilities Analysis
  34.  
  35. e-mail: stamhank@notes.cc.bellcore.com
  36.  
  37.  
  38.